package com.rss.inbound.advices;

import org.apache.log4j.Logger;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class LoggerAdvice
{
    Logger logger = Logger.getLogger(LoggerAdvice.class);
    
    @Pointcut("execution(* *.*(..)) && within(com.rss.*.*.*)")
    public void loggerPointCut()
    {
    }

    @Before(value = "loggerPointCut()")
    public void logBeforeMethod(JoinPoint joinPoint)
    {
	logger.debug("Start of " + joinPoint.getSignature());
    }

    @After("loggerPointCut()")
    public void logAfterMethod(JoinPoint joinPoint)
    {
	logger.debug("End of " + joinPoint.getSignature());
    }
}
